<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.LogsControl"
    CodeBehind="Logs.ascx.cs" %>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-system.png" alt="System" />
        System Log
    </div>
    <div class="options">
        <asp:Button ID="btnClear" runat="server" CssClass="adminButtonBlue" Text="Clear Log"
            OnClick="btnClear_Click" CausesValidation="false" ToolTip="Clear system log" />
    </div>
</div>
<asp:GridView ID="gvLogs" runat="server" AutoGenerateColumns="False" Width="100%"
    OnPageIndexChanging="gvLogs_PageIndexChanging" AllowPaging="true" PageSize="15">
    <Columns>
        <asp:BoundField DataField="LogID" HeaderText="Log ID" Visible="False"></asp:BoundField>
        <asp:BoundField DataField="LogType" HeaderText="Log type" ItemStyle-Width="12%">
        </asp:BoundField>
        <asp:TemplateField HeaderText="Customer" ItemStyle-Width="15%">
            <ItemTemplate>
                <%#GetCustomerInfo(Convert.ToInt32(Eval("CustomerID")))%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Created on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="18%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Message" ItemStyle-Width="20%">
            <ItemTemplate>
                <a href="LogDetails.aspx?LogID=<%#Eval("LogID")%>" title="View log details">
                    <%#Server.HtmlEncode(Eval("Message").ToString())%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Details" ItemStyle-Width="15%">
            <ItemTemplate>
                <a href="LogDetails.aspx?LogID=<%#Eval("LogID")%>" title="View log details">Details</a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="DeleteLogButton" runat="server" CssClass="adminButton" CommandName="DeleteLog"
                    Text="Delete" CommandArgument='<%#Eval("LogID")%>' OnCommand="DeleteLogButton_OnCommand"
                    CausesValidation="false" ToolTip="Delete log entry" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
